package com.hhwf.jobclient.config;

import com.hhwf.task.TaskClient;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

/**
 * @Auther: Witt
 * @Date: 2019/2/2 18:15
 * @Description:
 */
@Configuration
public class TaskConfig {

    @Value("${serviceIp}")
    private String serviceIp ;

    @Value("${port}")
    private String port;

    @Bean
    public TaskClient getTaskClient(){
        TaskClient taskClient = new TaskClient(serviceIp,Integer.parseInt(port));
        return taskClient;
    }

}
